package com.javaEE.tes.services;

import com.javaEE.tes.dao.TeacherRepository;
import com.javaEE.tes.dao.dto.CharData;
import com.javaEE.tes.entities.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherService {
    @Autowired
    TeacherRepository teacherRepository;
    public Teacher save(Teacher teacher){
        return teacherRepository.save(teacher);
    }
    public List<Teacher> getAll(){return teacherRepository.findAll();}
    public Teacher findByUserAccount_UserId(Long userId){
        return teacherRepository.findByUserAccount_UserId(userId);
    }

}
